#$Id$
# Maintainer: tobias <tobias@arhlinux.org>

pkgname=exiv2
pkgver=0.26
pkgrel=2
pkgdesc="Exif, Iptc and XMP metadata manipulation library and tools"
arch=('i686' 'x86_64')
url="http://exiv2.org"
license=('GPL2')
depends=('gcc-libs' 'zlib' 'expat')
makedepends=('cmake')
source=($pkgname-$pkgver.tar.gz::"https://github.com/Exiv2/exiv2/archive/v$pkgver.tar.gz"
        exiv2-fix-segfault.patch::"https://github.com/Exiv2/exiv2/commit/5405d616.patch")
md5sums=('5a32bfa41b5e5409c9347b227350e100'
         '2f3a0bf2ceb9f2143f97fe1afb3c8c54')

prepare() {
  cd $pkgname-$pkgver
  patch -p1 -i ../exiv2-fix-segfault.patch # http://dev.exiv2.org/issues/1305
}

build() {
  cd $pkgname-$pkgver 
  cmake . \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DEXIV2_ENABLE_VIDEO=ON \
    -DEXIV2_ENABLE_BUILD_PO=ON \
    -DEXIV2_ENABLE_BUILD_SAMPLES=OFF \
    -DCMAKE_INSTALL_LIBDIR=lib
  make
}

package() {
  cd $pkgname-$pkgver
  make DESTDIR="${pkgdir}" install
}
